package jym.tan.tmdb.method.get;

import java.net.URL;

import jym.tan.tmdb.TMDB;
import jym.tan.tmdb.constant.TMDBConstants;
import jym.tan.tmdb.method.Base;

/**
 * The Class MovieInfo. This class is similar to the <b>Movie Info</b> method described in 
 * <a href="http://help.themoviedb.org/kb/api/movie-info">Movie Info</a>.
 * This method is used to retrieve all of the basic movie information. It will return the 
 * single highest rated poster and backdrop.
 */
public class MovieInfo extends Base {

	/**
	 * Instantiates a new MovieInfo.
	 *
	 * @param tmdb 
	 * 		An instance of the {@link TMDB} class
	 */
	public MovieInfo(TMDB tmdb) {
		super(tmdb, TMDBConstants.MOVIE);		
	}
	
	/**
	 * Gets a {@link jym.tan.tmdb.bean.MovieInfo} object.
	 *
	 * @param movieId 
	 * 		The TMDB id / the IMDB id
	 * @param language 
	 * 		The language parameter tries to localize the movie data we return. If the 
	 * 		language being requested does not exist, the value will be left blank. 
	 * 		The expected value is a ISO 639-1 code
	 * @return 
	 * 		The <code>jym.tan.tmdb.bean.MovieInfo</code> object
	 * @throws Exception 
	 * 		If any kind off exception occurred
	 */
	public jym.tan.tmdb.bean.MovieInfo getMovieInfo(String movieId, String language) throws Exception {
		URL infoURL = getUrl(movieId, language, TMDBConstants.BLANK);
		jym.tan.tmdb.bean.MovieInfo movieInfo = getJsonObject(infoURL, jym.tan.tmdb.bean.MovieInfo.class);		
		return movieInfo;		
	}
}
